package ProcessList;

import Main.Defines;
import ProcessManager.Process;

public class MoveCurrentPlayer extends Process {
	private double locX;
	private double locY;
	private double TargetX;
	private double TargetY;
	int MoveAmount;
	int Time;
	double DistanceX;
	double DistanceY;

	public MoveCurrentPlayer(int a_MoveAmount, int a_Time) {
		super("MoveCurrentPlayer");
		MoveAmount = a_MoveAmount;
		Time = a_Time;
	}

	public void destroy() {
	}

	public void UpdateProcess(int milliseconds) {
	}

	public void InitializeProcess() {
		// TODO debugging
		System.out.printf("MoveAmount: %d\n", MoveAmount);
		
		int TargetDay = MoveAmount + Defines.CP().getDay();
		
		// TODO debugging
		System.out.printf("targetDay: %d\n", TargetDay );
		System.out.printf("Current Player Day: %d\n", Defines.CP().getDay() );
		
// TODO //////// MAGIC NUMBERS! //////////////////////////////////
// TODO // These magic numbers need to be reset to the game board.
		// Get the current x,y location of the player
		locX = (((( Defines.CP().getDay()-1)%7)*(2.85))-12.5);
		locY = (8-(((Defines.CP().getDay()-1)/7)*4.05));
		// Get the target x,y location of the player
		TargetX = ((((TargetDay-1)%7)*(2.85))-12.5);
		TargetY = (8-(((TargetDay-1)/7)*4.05));
		
		// Find out the distance to move aka between the two locations
		DistanceX = TargetX - locX;
		DistanceY = TargetY - locY;
		
		// TODO debugging:
		System.out.printf("locX: %f\n", locX);
		System.out.printf("locY: %f\n", locY);
		System.out.printf("TargetX: %f\n", TargetX);
		System.out.printf("TargetY: %f\n", TargetY);
		System.out.printf("DistanceX: %f\n", DistanceX);
		System.out.printf("DistanceY: %f\n", DistanceY);
	}

}
